using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Component;
using System.IO;
using DevExpress.Xpo;

public partial class FrontEnd_Center_Gallery : System.Web.UI.UserControl
{
    protected ArrayList ads;
    protected void Page_Load(object sender, EventArgs e)
    {
        DirectoryInfo dire = new DirectoryInfo(ConstString._PathFileGallery);
        ads = new ArrayList();
        string js = "<script language=\"javascript\" type=\"text/javascript\">";
        js += "var arrAdsImage = new Array(); var arrAdsUrl = new Array();";
        int count = 0;
         XPCollection<Gallery> _xpGallery = GalleryDB.GetAll();
         foreach (Gallery gall in _xpGallery)
        {
                ads.Add(gall.Path); 
                js += "arrAdsImage[" + count + "] = '" + gall.Path + "';";
                count++;
        }
        js += "</script>";
        this.scriptAds.InnerHtml = js;
    }
}
